/**
 * 
 */
package com.geezdata.cps.ttk_admin.api.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.geezdata.cps.base.annotation.LoggerOut;
import com.geezdata.cps.base.response.BaseResponse;
import com.geezdata.cps.cqrs.command.Command;
import com.geezdata.cps.cqrs.command.bus.CommandBus;
import com.geezdata.cps.ttk.common.request.CreateOrUpdateOrderSyncTaskRequest;

/**
 * @author sszheng
 * @date 创建时间：2018年6月19日 下午4:55:17
 *
 */
@RestController
@RequestMapping(value="/order_sync_task")
public class OrderSyncTaskController {
	@Autowired
	private CommandBus commandBus;
	@Autowired
	private Command<CreateOrUpdateOrderSyncTaskRequest, Object> createOrUpdateOrderSyncTaskCommand;
	
	@LoggerOut
    @RequestMapping(value = "/createOrUpdateOrderSyncTask", method = RequestMethod.POST)
    public BaseResponse<Object> createOrUpdateOrderSyncTask(@RequestBody CreateOrUpdateOrderSyncTaskRequest request) {
		return commandBus.dispatch(createOrUpdateOrderSyncTaskCommand, request);
    }
	
}
